////////////////////////////////////////////////////////////////////////////////
// Copyright 2006 CORE Solutions Limited
// All rights reserved.
// PROPRIETARY AND CONFIDENTIAL INFORMATION.
// Use is subject to license terms.
//
// FUNCTION ID      :   
// AUTHOR           :   Ric Yik 
// DATE CREATE      :   2006/01/11
// DESCRIPTION      :   A Base Class for custom Http Sessions
//                  :   
//                  :   
//                  :   
//
// MODIFICATION HISTORY:
// DATE         AUTHOR          VERSION NO.         COMMENT
// -----------  --------------  ------------------  -------------------
// 2006/01/11   Ric Yik         1.0                 source is created.
//
//
//
////////////////////////////////////////////////////////////////////////////////

package com.erp.common.web;

import javax.servlet.http.HttpSession;

import com.erp.app.common.ProjectConstants;
import com.erp.framework.util.user.User;

public abstract class SimpleBaseSession {

    protected final HttpSession session;

    public SimpleBaseSession(HttpSession session) {
        super();
        if (session == null) throw new IllegalArgumentException("session cannot be null");
        this.session = session;
    }

    public HttpSession getSession() {
        return session;
    }

    public User getEditingUser() {
        return (User) this.getSession().getAttribute(ProjectConstants.SESSION_USER);
    }

}
